import request from '@/utils/request';

/**
 * getCategoryList
 * @description 获取列表
 * @param data 
 * @returns 
 */
export const getCategoryList = (data) => {
  return request('/yst-workflow/workflow/api/category/search', {
    method: 'post',
    query: data
  });
};

/**
 * getCategoryById
 * @description 根据id查详情
 * @param id 
 * @returns 
 */
export const getCategoryById = (id) => {
  return request(`/yst-workflow/workflow/api/category/${id}`, {
    method: 'get'
  });
};

/**
 * saveCategory
 * @description 保存
 * @param data 
 * @returns 
 */
export const saveCategory = (data) => {
  return request('/yst-workflow/workflow/api/category', {
    method: 'post',
    query: data
  });
};

/**
 * deleteCategory
 * @description 删除
 * @param id 
 * @returns 
 */
export const deleteCategory = (id) => {
  return request(`/yst-workflow/workflow/api/category/${id}`, {
    method: 'delete'
  });
};
